package com.hujing;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App 
{

    private static final Logger log = LoggerFactory.getLogger(App.class);

    public static void main( String[] args ) {
        long start = System.currentTimeMillis();
        List<String> list = new ArrayList<>();
        try {
            while (true){
                list.add("Hello World!");
            }
        } catch (Exception e) {
            log.error("异常:{}", e.getMessage(),e);
        }finally {
            long end = System.currentTimeMillis();
            System.out.println("耗费时间: " + (end - start) + "ms");
            System.out.println("内存溢出时，list的大小: " + list.size());
        }
    }
}
